#include "EPSG/Sphere.h"

/* System Includes */
#ifdef WIN32
	#include <Windows.h>
#endif

/* OpenGL Includes */
#include <GL/GL.h>
#include <GL/GLU.h>

EPSG::Sphere::Sphere()
{
	_stacks = _slices = 32;

	_quadric = gluNewQuadric();
	gluQuadricDrawStyle( _quadric, GLU_FILL );
	gluQuadricNormals( _quadric, GLU_SMOOTH );
}

EPSG::Sphere::~Sphere()
{
	gluDeleteQuadric( _quadric );
}

void EPSG::Sphere::draw( bool autoTexCoord /*= true */ )
{
	gluQuadricTexture( _quadric, autoTexCoord );
	gluSphere( _quadric, _radius, _stacks, _slices );
}

void EPSG::Sphere::setRadius( float radius )
{
	_radius = radius;
}

void EPSG::Sphere::setSlices( int slices )
{
	_slices = slices;
}

void EPSG::Sphere::setStacks( int stacks )
{
	_stacks = stacks;
}